/*
 * Copyright 2009 XueSong Guo.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.webwheel.utils;

import cn.webwheel.WebContext;

/**
 * 简单结果，注入{@link cn.webwheel.WebContext}对象，并依赖自身的结果渲染方式。
 */
abstract public class SimpleResult {

    protected WebContext context;

    /**
     * 注入当前应用程序的上下文，由{@link cn.webwheel.utils.SimpleResultInterpreter}类进行注入。
     * @param context web应用程序上下文
     */
    public void setWebContext(WebContext context) {
        this.context = context;
    }

    /**
     * 渲染结果方法，此方法将在{@link cn.webwheel.utils.SimpleResultInterpreter}类中调用。
     * @throws Exception 任何异常
     */
    public abstract void render() throws Exception;
}
